Option Explicit
Sub Q_Sample003()
    'wɮצW١BgROCO
    Open ThisWorkbook.Path & "\test.bat" For Output As #1
    Print #1, "cmd /c Dir """ & ThisWorkbook.Path & """ > """ & _
        ThisWorkbook.Path & """\test.txt"
    Close #1
    'ɮת
    Shell "cmd.exe /c """ & ThisWorkbook.Path & "\test.bat"""
End Sub
